package com.example.shushiyunsst.fragment.main.home

import android.os.Bundle
import android.view.View
import com.example.library_common.base.BaseFragmentEx
import com.example.library_common.base.LazyFragment
import com.example.library_common.view.bottombar.BottomBorInfo
import com.example.shushiyunsst.R

class HomePanelFragment : LazyFragment() , BottomBorInfo {

    companion object{
        fun newInstance(): HomePanelFragment {
            val args = Bundle()
            val fragment = HomePanelFragment()
            fragment.arguments = args
            return fragment
        }
    }

   private var newInstance = HomeFragment.newInstance()

    override var icon = R.drawable.ic_home

    override fun refreshData() {
        newInstance.refreshData()
    }

    override var title = R.string.first_page

    override fun getLayoutId()= R.layout.home_panel_fragment


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        if(savedInstanceState==null){

            loadRootFragment(R.id.home_page,newInstance)

//            newInstance.refreshData()
        }
    }

    override fun lazyInit() {
        newInstance.requestData()
    }

    override fun initView(view: View) {

    }

}